//考耐心的题，有点烦，变量有点多，一一注意就可以了
#include<iostream>
using namespace std;
struct Cards
{
    string name,terminal,operators,issure;
    string Validity,number,traded,costs;
};
int main()
{
    int time;
    cin>>time;
    while(time--)
    {
        Cards tmp;
        cin>>tmp.name>>tmp.terminal>>tmp.operators>>tmp.issure>>tmp.Validity;
        cin>>tmp.number>>tmp.traded>>tmp.costs;
        int n=tmp.number.size();
        for(int i=4;i<=11;i++)
        {
            tmp.number[i]='*';
        }
        cout<<"Name: "<<tmp.name<<endl;
        cout<<"Terminal: "<<tmp.terminal<<" operator: "<<tmp.operators<<endl;
        cout<<"Card Issuers: "<<tmp.issure<<" Validity: "<<tmp.Validity<<endl;
        cout<<"CardNumber: "<<tmp.number<<endl;
        cout<<"Traded: "<<tmp.traded<<endl;
        cout<<"Costs: $"<<tmp.costs<<endl;
        cout<<endl;
    }
}